package com.example.springboot.service;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot.entity.Charts;
import com.example.springboot.mapper.ChartsMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ChartsService extends ServiceImpl<ChartsMapper, Charts> {

    @Resource
    private ChartsMapper chartsMapper;

    public Charts getByName(String equipmentName) {
        return chartsMapper.getByName(equipmentName);
    }

    public List<Charts> SelectAll() {
        return chartsMapper.SelectAll();
    }

    public void add(Charts charts) {
        charts.setTime(DateUtil.now());
    }
}

